﻿<!--#include file="const.inc"-->
<%
'====================================================================
' 感谢使用晴天3G智能建站系统..
' 作者:梁永强.QQ:766750857
' 官方网址:wap.qt3g.com
' 声明:软件版权归作者所有,没有经过作者本人同意不得非法破解和传播本程序
'====================================================================
%>
<%
if sid="Null" then
Response.Redirect "/login.asp?sid=" & sidd & "&url=/diy/Transfmp3.asp"
Response.end
end if
bitttt=qingtian.confff("bit")
bittt=conn.execute("select money from [qingtian_user] where sid='"&qingtian.Formatsid(sid)&"'")("money")
select case v
case "0"
we0="<br/>"
hr="-----------<br/>"
%>
<card title="文字铃声DIY合成系统"><p align="<%=qingtian.px%>">
<%
case "1"
zi="<span style=""color:#FF5500"">"
we="<div class=""footer"">"
sou="<div class=""block4"">"
dao="<div class=""navi"">"
we0="</div>"
we1="</div>"
%>
<title>文字铃声DIY合成系统</title>
</head>
<body>
<!--#include virtual="/css.inc"-->
<%

End Select
%>
<%=qingtian.qingsav("10086")%>
<%
on error resume next
Dim fs, f, f1, fc,cs,i,fsod,Filedel
i=0 
Filepath=Server.MapPath("/diy/music/")
Set fs = CreateObject("Scripting.FileSystemObject") 
Set f = fs.GetFolder(Filepath)
Set fc = f.Files
For Each f1 in fc
i=i+1
Next
If i>15 Then
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(Filepath)
Set fc = f.Files
For Each f1 in fc
Filedel=Filepath&"/"&f1.name
set fsod = createobject("scripting.filesystemobject")
If (fsod.fileexists(Filedel)) Then
fsod.deletefile(Filedel)
End If
set fsod = Nothing
i=i+1
Next
End If
Response.Write(""&dao&"=文字铃声DIY合成系统="&we0&""&we&"")	
Dim backurl,mo2,mob,ii,filename1,cc
filename1="Transfmp3.asp"	'本文件名
cc=clng(request("cc"))
backurl=request("backurl")
backurl=Replace(backurl,"@@","&")
If left(backurl,1)<>"/" Then backurl="/" & backurl
mo2=split(backurl,".")
mob=lcase(mo2(ubound(mo2)))	'字符变小写参数前加
ii="jpg|gif|bmp|jpeg|peg|png|jpge|mid|midi|mmf|amr|img|adp|m4a|mp3|aac|wav|wma|ogg|avi|mp4|3gp|wmv|rm|rmvb|dat|mpg|asf|umd|txt|chm|brm|prc|pdb|mdx|trc|sis|sisx|jar|jad|cab|mpkg|hme|ski|thm|uiq|nth|utz|mtf|sdt|tsk|nec|nes|gba|gb|gbc|gba|fba|md|sfc|smc|lrc|nol|rar|zip|7z|emz|pdf|pdg|qcp"
If instr(ii,mob)>0 Then
Response.redirect "http://61.135.130.159/voice_tmp" & backurl
Response.End
End If
%>
<%
text1=TRim(Request("text1"))
backmusic=TRim(request("backmusic"))
vol=TRim(request("vol"))
If text1<>"" and backmusic<>"" Then
If bittt<bitttt and qingtian.vip(qingtian.nid)<>"VIP会员" Then 
Response.Write "出错了！你的"&qingtian.bi&"不够哦！"
else
If len(text1)>135 Then
Response.Write "出现错误！字符不得超过135个字符！<br/>"
Else
backmusic=Server.urlencode(backmusic)
sd=Request("sd")
id=Server.urlencode(Request("id"))
bg=Request("bg")
bt=Server.urlencode(Request("bt"))
If bg="" Then bt="mp3"
t_sks=1200
t_text=Application(Filename1 & sid & text1 & id & backmusic & sd & vol & bg & bt & id)
If t_text="" or DateDiff("s",t_text,now())>t_sks Then		'缓存为空时，读取远程数据
Dim Url,Data,Html,start,over,body,wap,wstr,str
If instr(bg,".")>0 Then
Url="http://61.135.130.159/tts.aspx?txt=" & Server.urlencode(text1) & "&pid=" & id & "&tt=" & backmusic & "&ss=" & sd & "&vol=" & vol & "&tc=&bg=http://" & Request.ServerVariables("Server_NAME") & "/diy/ring/" & bg & "&bt=" & Right(bg,3)
Else
Url="http://61.135.130.159/tts.aspx?txt=" & Server.urlencode(text1) & "&pid=" & id & "&tt=" & backmusic & "&ss=" & sd & "&vol=" & vol & "&tc=&bg=" & bg & "&bt=" & Right(bg,3)
End If
'传送过去的内容
wstr=qingtian.getHTTPPage1(url)
start=Instr(wstr,"/voice_tmp/")
over=Instr(wstr,"</path>")
body=mid(wstr,start,over-start)
'-------------以下替换内容------------
body = replace(body,Chr(10),"")
body = replace(body,Chr(13),"")
body = replace(body,"""","'")
body = replace(body,vbndwline,"")
body = replace(body,vbLf,"")
body = replace(body,vbCr,"")
'-------------------------------------
	Set re=new RegExp
	re.IgnoreCase =true
	re.Global=True
	re.pattern="/voice_tmp/(.+?).(mp3|wav|qcp|amr|mmf)"
	body= re.Replace(body,"$1.$2")
'-------------------------------------
If len(body)<1 Then
Response.Write "对不起，由于网络原因数据获取失败，请稍候再试！<br/>"
Else
Application(Filename1 & sid & text1 & id & backmusic & sd & vol & bg & bt & id)=body
%>
<%
RemoteFileUrl ="http://61.135.130.159/voice_tmp/" & body
FileExt = right(RemoteFileUrl,4) 
randomize
ranNum = int(9*10^3*rnd)+10^3
dtNow = Now()
FileName = year(date) & month(date) & day(date) & minute(now()) & second(now()) & "_"  & Replace(Request.ServerVariables("Server_NAME"),".",".") & FileExt
LocalFileName = "/diy/music/" 
if right(LocalFileName,1) <> "/" then LocalFileName = LocalFileName & "/"
SaveFile = server.mappath(LocalFileName & FileName)
SaveRemoteFile SaveFile,RemoteFileUrl 
saveimg=LocalFileName & FileName 
uurl=saveimg
Dim filetest,filesize
set filetest=server.CreateObject("Scripting.FileSystemObject")
filesize=filetest.GetFile(server.MapPath(uurl)).size
If filesize<>"" and filesize>0 Then
if qingtian.vip(qingtian.nid)="VIP会员" then
qingtian.addong("在[url=/diy/Transfmp3.asp?sid=[sid]]铃声合成系统[/url]制作了一首铃声")
Response.Write Right(body,3) & "制作成功，文件大小为" & FormatNumber(filesize/1024,1) & "KB<br/>"
Response.Write "<a href='" & uurl & "'>免费下载</a><br/>"
else
qingtian.payy("-"&bitttt)
qingtian.addong("在[url=/diy/Transfmp3.asp?sid=[sid]]铃声合成系统[/url]制作了一首铃声")
Response.Write Right(body,3) & "制作成功，文件大小为" & FormatNumber(filesize/1024,1) & "KB<br/>系统自动扣除你"&bitttt&""&qingtian.bi&"<br/>你现在的"&qingtian.bi&":"&bittt&"<br/>"
Response.Write "<a href='" & uurl & "'>免费下载</a><br/>"
end if
Else
Response.Write "对不起，由于网络原因文件获取失败，请稍候再试！<br/>"
End If
set filesize=nothing
set filetest=nothing
End If
Else '直接输出缓存
Response.Write t_text
End If
End if
End if
End if
%>
<%=we1%><%=hr%><%=sou%>注意:<%=zi%>普通会员每次制作系统自动扣除<%=bitttt%><%=qingtian.bi%>(VIP会员免费制作)<%=zi0%><%=we0%>
<%
        if v=1 then
	%>
        <form action="<%=filename1%>?sid=<%=sidd%>" method="post">
<%=we%>
输入文字(最多135字符)<br/>
<textarea name="text1" rows="5"/></textarea><br/>
        <%
        else
	%>
输入文字(最多135字符)<br/>
<input name="text1" type="text" maxlength="135" value=""/><br/>
        <%
        end if
        %>
发音样式:<%if len(backmusic)<>0 then%><select name="backmusic" value="<%=backmusic%>">
<%else%><select name="backmusic" value="XiaoKun">
<%end if%>
<option value="Zhaqian">女声Zhaqian</option>
<option value="XiaoNan">女声XiaoNan</option>
<option selected="selected" value="XiaoKun">女声XiaoKun</option>
<option value="ZhuYun">女声ZhuYun(台湾腔)</option>
<option value="HaoBo">男声HaoBo</option>
<option value="XiaoJie">广东话XiaoJie(女)</option>
</select><br/>
声音大小:<%if len(vol)<>0 then%><select name="vol" value="<%=vol%>">
<%else%><select name="vol" value="5">
<%end if%>
	<option value="0">0</option>
	<option value="1">1</option>
	<option value="2">2</option>
	<option value="3">3</option>
	<option value="4">4</option>
	<option selected="selected" value="5">5</option>
	<option value="6">6</option>
	<option value="7">7</option>
	<option value="8">8</option>
	<option value="9">9</option>
</select><br/>
播放速度:<%if len(sd)<>0 then%><select name="sd" value="<%=sd%>">
<%else%><select name="sd" value="5">
<%end if%>
	<option value="0">0</option>
	<option value="1">1</option>
	<option value="2">2</option>
	<option value="3">3</option>
	<option value="4">4</option>
	<option selected="selected" value="5">5</option>
	<option value="6">6</option>
	<option value="7">7</option>
	<option value="8">8</option>
	<option value="9">9</option>
</select><br/>
<!--音乐URL<%
diyurl=Request.querystring("diyurl")
If instr(Curl,Request.ServerVariables("Server_NAME"))>0 Then
Response.Write "或<a href=""/ups/addup.asp?urlup=" & Request.ServerVariables("SCRIPT_NAME") & """>上传音乐(MID格式)</a><br/>"
Else
Response.Write "<br/>"
End If
%><input name="bg" type="text" maxlength="110" value="<%=diyurl%>"/><br/-->
背景音乐:<%if len(bg)<>0 then%><select name="bg" value="<%=bg%>">
<%else%><select name="bg">
<%end if%>
	<option selected="selected" value="">无</option>
	<option value="tiexuedanxin.mid">铁血丹心</option>
	<option value="lianqu2000.mid">恋曲2000</option>
	<option value="milaoshu.mid">米老鼠进行曲</option>
	<option value="tianxianpei.mid">天仙配</option>
	<option value="daguniang.mid">大姑娘美大姑娘浪</option>
	<option value="mingyueqianlijixiangsi.mid">明月千里寄相思</option>
	<option value="jiangnan.mid">江南</option>
	<option value="guizijincun.mid">鬼子进村</option>
	<option value="hexinnian.mid">贺新年</option>
	<option value="lerxdd.mid">铃儿响叮当</option>
	<option value="shengrikuaile.mid">生日快乐</option>
	<option value="zhubajie.mid">猪八戒背媳妇</option>
	<option value="laoshuaidami.mid">老鼠爱大米</option>
	<option value="jungangzhiye.mid">军港之夜</option>
	<option value="liangzhu.mid">梁祝</option>
	<option value="tongnian.mid">童年</option>
	<option value="tangewuqu.mid">探戈舞曲</option>
	<option value="god_is_a_girl.mid">上帝是个女孩</option>
	<option value="zhiailisi.mid">致爱丽丝</option>
	<option value="yongyuandeai.mid">永远的爱</option>
	<option value="mamahao1.mid">世上只有妈妈好</option>
</select><br/>

<!--音乐类型:<select name="bt">
	<option selected="selected" value="mp3">mp3</option>
	<option value="wav">wav</option>
	<option value="qcp">qcp</option>
	<option value="mid">mid</option>
</select><br/-->
输出格式:<select name="id" value="mp3">
	<option value="wav">wav</option>
<!--	<option value="qcp">qcp</option>-->
	<option selected="selected" value="mp3">mp3</option>
	<option value="amr">amr</option>
	<option value="mmf">mmf</option>
</select><!--由于空间限制暂不支持mp3格式下载!--><br/>
<!--验证码:<img src="../code.asp?moozhi=<%=int(tt1)%>" alt="验证码"/><br/>
[需打开图片显示]<br/>
输入验证码:<input type="text" name="mofei<%=int(tt1)%>" format="*N" emptyok="true" maxlength="4" size="5"/><br/-->
        <%
        if v=0 then
Response.Write "<anchor title=""submit"">转换真人语音<go href=""" & filename1 & "?sid=" & sidd & """ method=""post"">"
%>
<postfield name="text1" value="$(text1)"/>
<postfield name="id" value="$(id)"/>
<postfield name="vol" value="$(vol)"/>
<postfield name="sd" value="$(sd)"/>
<postfield name="bg" value="$(bg)"/>
<postfield name="bt" value="$(bt)"/>
<postfield name="backmusic" value="$(backmusic)"/>
<postfield name="mofei" value="$(mofei)"/>
</go>
</anchor><br/>
        <%
        else
	%><%=we1%>
        <input type="submit" value="转换真人语音"/>
        </form><br/>
	<%
	end if
	%>
<%=we%><%=hr%>
此系统能把文字铃声DIY合成真人说话,而且能通过彩信发送到朋友的手机里.快告诉你的朋友来这里也转几首铃声吧,古话说的好,独乐乐不如众乐乐.<br/>
背景音乐可以随意更新添加,觉得有好听的背景音乐请联系我们更新！我们会根据效果采纳!(背景音乐为MID格式)<br/>
温馨提示:转换成wav格式的文件可能会比较大!<%=we0%><%=qingtian.qingsav("10087")%>
<%=sou%><a href='index.asp?sid=<%=sidd%>'>返回制作首页</a><%=we0%>
<%
End function
sub SaveRemoteFile(LocalFileName,RemoteFileUrl)
dim Ads,Retrieval,GetRemoteData
Set Retrieval = Server.CreateObject("Microsoft.XMLHTTP")
With Retrieval
.Open "Get", RemoteFileUrl, False, "", ""
.Send
GetRemoteData = .ResponseBody
End With
Set Retrieval = Nothing
Set Ads = Server.CreateObject("Adodb.Stream")
With Ads
.Type = 1
.Open
.Write GetRemoteData
.SaveToFile LocalFileName,2
.Cancel()
.Close()
End With
Set Ads=nothing
end sub
%>